<template>
	<view class="container">
		<navbar :config="config" backColor="#999"></navbar>
		<view class="list" v-if="withdrawList.length > 0">
			<view class="item" v-for="(item,index) in withdrawList" :key="item.id">
				<view class="u-flex-center-sb u-181818">
					<view class="u-font26"> <text>{{item.money}}</text>
					  <text v-if="item.payment_term==0">（微信）</text>
					   <text v-if="item.payment_term==1">（支付宝）</text>
					    <text v-if="item.payment_term==2">（银行卡）</text>
						<text v-if="item.payment_term==4">（公益积分）</text>
					</view>
					<view class="u-0067DE u-font24" v-if="item.verify_status==0">待审核 </view>
					<view class="u-179400 u-font24" v-if="item.verify_status==1">审核通过 <text>{{item.remit_status==1?'，已打款':'，未打款'}}</text> </view>
					<view class="u-D40007 u-font24"v-if="item.verify_status==2">审核不通过</view>
				</view>
				<view class="u-flex-center-sb u-mt10">
					<view class="u-font22" style="width: 240rpx;flex-shrink: 0;margin-right: 20rpx;">{{item.create_time}}</view>
					<view class="u-999 u-font22" style="word-break:break-all;text-align: right;" v-if="item.verify_status==2"> 
					<!-- <text class="iconfont">&#xe682;</text> -->
					{{item.verify_opinion}}</view>
				</view>
			</view>
		</view>
		<!-- 没有数据 -->
		<loadMore v-if="withdrawList.length>0" :status="status"></loadMore>
			<nodata v-else :config="{top:5,content:'暂无兑换明细~'}"></nodata>
		
	</view>
</template>

<script>
	export default {
			data() {
				return {
					config: {
						back: true, //false是tolbar页面 是则不写
						title: '兑换明细',
						color: '#1A1A1A',
						//背景颜色;参数一：透明度（0-1）;参数二：背景颜色（array则为线性渐变，string为单色背景）
						backgroundColor: [1, "#ffffff"],
						statusBarFontColor: '#1A1A1A'
					},
					params:{
						page:1,
						limit:10,
					},
					withdrawList:[],
					status:"more",
					totalPage:null,
					currPage:null
				}
			},
			onLoad() {
				//获取交易明细
				this.getList()
				
				// this.$http.get('/withdraw/memberPage',).then(res => {
				// 	console.log('res.code',res.code)
				// 	if(res&&res.code==200){
				// 	 this.withdrawList=res.list
				// 	}
				// })
			},
			//上拉加载
			onReachBottom(e) {
				if(this.totalPage<=this.currPage){
					this.status="noMore"
				}else{
					this.status="more"
					this.params.page++
					this.getList()
				}
			},
			//下拉刷新
			onPullDownRefresh() {
				this.params.page=1
				this.withdrawList=[]
				this.getList()
			},
			
			methods:{
				getList(){
					this.$http.get('/withdraw/memberPage',this.params).then(res => {
						if(res&&res.code==200){
							console.log(res.page.list)
							uni.stopPullDownRefresh()
							this.withdrawList = this.withdrawList.concat(res.page.list) 
							this.totalPage = res.page.totalPage
							this.currPage = res.page.currPage
							
							if(this.totalPage<=this.currPage){
								this.status="noMore";
							}else{
								this.status = "more"
							}
							// if(this.billRefillCardList.length==0){
							// 	this.noData = true
							// }else{
							// 	this.noData = false
							// }
						}
						})
				}
				
			}
		}
</script>

<style lang="scss">
	.list{
		.item{
			padding:20rpx 30rpx 24rpx;
			border-bottom: 1rpx  solid #E6E6E6;
		}
	}
</style>
